package cn.xxliang.platapp.controller;

import cn.xxliang.platapp.common.BaseRespWithData;
import cn.xxliang.platapp.pojo.dto.PlatProductInfoDto;
import cn.xxliang.platapp.pojo.query.PlatProductInfoQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

@RestController
@RequestMapping("/platProductInfo")
@Api(tags = "切片平台产品管理")
@Validated
public class PlatProductInfoController {

    @PostMapping("/add")
    @ApiOperation("新增切片平台产品 ✅")
    public BaseRespWithData add(@RequestBody @Valid PlatProductInfoDto dto) {
        return new BaseRespWithData().code(200).msg("新增成功");
    }

    @GetMapping("/get")
    @ApiOperation("详情-切片平台产品 ✅")
    public BaseRespWithData get(@RequestParam @NotNull(message = "主键不能为空") String platformProductId) {
        return new BaseRespWithData().code(200).msg("查询成功");
    }

    @GetMapping("/offPlatProduct")
    @ApiOperation("关闭-切片平台产品 ✅")
    public BaseRespWithData offPlatProduct(@RequestParam @NotNull(message = "主键不能为空") String platformProductId) {
        return new BaseRespWithData().code(200).msg("关闭成功/关闭中");
    }

    @GetMapping("/openPlatProduct")
    @ApiOperation("开启-切片平台产品 ✅")
    public BaseRespWithData openPlatProduct(@RequestParam @NotNull(message = "主键不能为空") String platformProductId) {
        return new BaseRespWithData().code(200).msg("开启成功/开启中");
    }

    // @PostMapping("/update")
    // @ApiOperation("编辑切片平台产品配置")
    // public BaseRespWithData update(@RequestBody @Valid PlatProductInfoDto dto) {
    //     return new BaseRespWithData().code(200).msg("更新成功");
    // }

    @PostMapping("/page")
    @ApiOperation("分页查询切片平台产品列表 ✅")
    public BaseRespWithData page(@RequestBody @Valid PlatProductInfoQuery query) {
        return new BaseRespWithData().code(200).msg("查询成功");
    }



   //================================产品-功能点================================

    @GetMapping("/getQosMenuPointList")
    @ApiOperation("查询切片平台产品下Qos的功能点列表 ，根据product_service_re查询对应的功能点，通过联查menu_point_re筛选对应的服务功能归属✅")
    public BaseRespWithData getQosMenuPointList(@RequestBody @NotNull(message = "切片平台产品ID不能为空") String platformProductId) {
        return new BaseRespWithData().code(200).msg("查询成功").data("Map<'xxx':List<MenuPointInfo>>");
    }

    @GetMapping("/getSmartDefineMenuPointList 根据product_service_re查询对应的功能点，通过联查menu_point_re筛选对应的服务功能归属✅")
    @ApiOperation("查询切片平台产品下智家守护的功能点列表")
    public BaseRespWithData getSmartDefineMenuPointList(@RequestBody @NotNull(message = "切片平台产品ID不能为空") String platformProductId) {
        return new BaseRespWithData().code(200).msg("查询成功").data("Map<'xxx':List<MenuPointInfo>>");
    }
    @GetMapping("/getSDKMenuPointList")
    @ApiOperation(value = "查询切片平台产品SDK功能的功能点列表 根据product_service_re查询对应的功能点，通过联查menu_point_re筛选对应的服务功能归属✅",response = PlatProductInfoDto.class)
    public BaseRespWithData getSDKMenuPointList(@RequestBody @NotNull(message = "切片平台产品ID不能为空") String platformProductId) {
        return new BaseRespWithData().code(200).msg("查询成功").data("Map<'xxx':List<MenuPointInfo>>");
    }
  

    //================================产品-应用================================

    @GetMapping("/getAppSystemList")
    @ApiOperation("查询切片平台产品下的应用列表,app_system_product_re中进行联查✅")
    public BaseRespWithData getAppSystemList(@RequestBody @NotNull(message = "切片平台产品ID不能为空") String platformProductId) {
        return new BaseRespWithData().code(200).msg("查询成功").data("Map<'xxx':List<ApplicationInfoDto>>");
    }

    //================================产品-可加速 application ================================
    @PostMapping("/getAppSoftwareList")
    @ApiOperation("查询切片平台产品下的可加速APP列表,product_service_application_re && product_service_re联查✅")
    public BaseRespWithData getAppSoftwareList(@RequestBody @NotNull(message = "切片平台产品ID不能为空") String platformProductId) {
        return new BaseRespWithData().code(200).msg("查询成功").data("Map<'xxx':List<ApplicationSoftwareInfoDto>>");
    }
}


